﻿using System;
using System.Net;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Documents;
using System.Windows.Ink;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Animation;
using System.Windows.Shapes;

namespace JavaSubstitutes
{
	//todo: let's clean this up- dump the actual extensions and make this the ONLY place that random #'s and gen'd, using the local Random obj (rnd)
	public static class RandomExtensions
	{
		private static Random rnd = new Random(1);

		public static double random()
		{
			return rnd.NextDouble();
		}

		public static int Next(int max)
		{
			return rnd.Next(max);
		}

		public static int nextint(this Random r)
		{
			return r.Next();
		}

		public static int nextInt()
		{
			return rnd.Next();
		}

		public static int nextInt(int maxValueNotInclusive)
		{
			return rnd.Next(maxValueNotInclusive);
		}

		public static int nextint()
		{
			return rnd.Next();
		}

		public static int nextInt(this Random r, int maxValueNotInclusive)
		{
			return r.Next(maxValueNotInclusive);
		}

		public static int nextLong(this Random r, int maxValueNotInclusive)
		{
			return r.nextInt(maxValueNotInclusive); //does it matter that we're not doing actual longs?
		}

		public static int nextLong(this Random r)
		{
			return r.Next(); //does it matter that we're not doing actual longs?
		}

		public static int nextLong()
		{
			return rnd.Next(); //does it matter that we're not doing actual longs?
		}

		public static double nextDouble(this Random r)
		{
			return r.NextDouble();
		}

		public static double nextDouble()
		{
			return rnd.NextDouble();
		}

		public static bool nextBoolean()
		{
			return rnd.NextDouble() >= .5;
		}

		public static bool nextBoolean(this Random r)
		{
			return r.NextDouble() >= .5;
		}


		//public static bool nextBool(this Random r)
		//{
		//    return r.NextDouble() >= .5;
		//}

		//public static int nextInt(this Random r, int n)
		//{
		//    return r.Next(n);
		//}
		
	}
}
